<template>
  <!-- Topnavigation -->
  <div class="nav-bars">
    <div class="nav-bar" :style="`background:${background};color:${color}`">
      <div class="nav-bar-left">
        <button :style="`color:${color}`" @click="buttonleft">
          <i class="iconfont  icon-fanhui1"/>
        </button>
      </div>
      <div class="nav-bar-contre">{{ title }}</div>
      <div class="nav-bar-right">
        <!--<button :style="`color:${color}`">
          按钮
        </button>-->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Topnavigation",
  data() {
    return {}
  },
  props: {
    title: {
      type: String,
      default: ''
    },
    background: {
      type: String,
      default: '#f2270c'
    },
    color: {
      type: String,
      default: '#FFFFFF'
    }
  },
  methods: {
    buttonleft: function () {
      this.$router.go(-1)
    }
  },
  mounted() {

  }
}
</script>

<style scoped lang="less">
.nav-bars {
  height: 44px;
  position: relative;
  z-index: 1;

  .nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    display: flex;

    .nav-bar-left {
      flex: 1;
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
    }

    .nav-bar-contre {
      flex: 3;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
    }

    .nav-bar-right {
      flex: 1;
      padding: 0 12px;
      display: flex;
      justify-content: center;
      align-items: center;

      button {
        //background: #FFF;  //默认的颜色
      }

      button:active {
        //background: #000;  //黑色
      }
    }

  }
}
</style>
